import fs from 'fs';

const readSteam = fs.createReadStream('./aaa.txt', {
    start: 8,
    end: 22,
    highWaterMark: 3
});

readSteam.on('data', (data) => {
    console.log(data.toString());
})
readSteam.on('open', (fd) => {
    console.log('通过流将文件打开~', fd);
});
readSteam.on('end', () => {
    console.log('已经读取到end位置');
});
readSteam.on('close', () => {
    console.log('文件读取结束，并且被关闭');
});